<template>
	<view>
		<view class="item-box">
			<view class="item" @click="goPaths('/pages/roommanagement/roommanagement')">
				<image src="../../static/images/roomSetTins.png" mode="包间管理"></image>
				<view>包间管理</view>
			</view>
			<!-- <view class="item"  @click="goPaths('/pages/storeinformation/storeinformation')">
				<image src="../../static/images/storeInfo.png" mode="店铺信息"></image>
				<view>店铺信息</view>
			</view> -->
			<view class="item" @click="goPath('/pages/devicecontrol/devicecontrol')">
				<image src="../../static/images/poword.png" mode="设备控制"></image>
				<view>设备控制</view>
			</view>
			<view class="item" @click="goPath('/pages/cleaningtasks/cleaningtasks')">
				<image src="../../static/images/clearmation.png" mode="保洁任务"></image>
				<view>保洁任务</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showType: uni.getStorageSync('userinfo').type,
			}
		},
		onShow() {
			if (!uni.getStorageSync('token')) {
				this.goLogins()
			}
		},
		methods: {
			goPaths(url) {
				if (this.showType != 1) {
					uni.showToast({
						title: '权限不足',
						icon: "none",
						duration: 1000
					})
					return;
				}
				if (this.showType == 1) {
					uni.navigateTo({
						url: url
					})
				}
			}
		}
	}
</script>

<style>
	page {
		background-color: #F0F2F5;
	}

	.item-box {
		display: flex;
		flex-wrap: wrap;
		margin-top: 40rpx;
		padding: 24rpx;
		gap: 48rpx 24rpx;
		align-content: space-between;
		justify-content: space-between;
		box-sizing: border-box;
	}

	.item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		width: 320rpx;
		height: 320rpx;
		background-color: #FFF;
		border-radius: 16rpx;
		box-shadow: 0px 0px 12px 0px rgba(189, 189, 189, 0.5);
	}

	.item image {
		width: 104rpx;
		height: 104rpx;
	}

	.item view {
		margin-top: 40rpx;
	}
</style>